package activity

import (
	"lao-a/helper"
	"lao-a/models/model"
)

const (
	TYPE_NORMAL = iota + 1
	TYPE_NOTUSE
)

// GetActivityTypes 获取活动分类字典
func (m *DAO) GetActivityTypes() ([]model.TdActivityType, error) {
	var types []model.TdActivityType

	if err := m.db.Where("status=?", TYPE_NORMAL).Asc("sort_no").Find(&types); err != nil {
		return nil, helper.LogError("查询活动分类字典出错", err)
	}

	return types, nil
}
